package com.wangbo.basic;

/**
 * 递归
 */
public class Test {
    public static void main(String[] args) {
        // 阶乘求积
//        int product = RecursionUtil.factorial(6);
//        System.out.printf("6的阶乘积=%d%n", product); // 6的阶乘积=720

        // 数组是否递增
//        int[] array1 = {1, 2, 3, 3, 4, 5, 7};
//        int[] array2 = {1, 2, 4, 3, 4, 5, 7};
//        int[] array3 = {1, 5, 8, 9, 15, 34, 56};
//        System.out.println(RecursionUtil.isArrayIncreased(array1, 0)); // true
//        System.out.println(RecursionUtil.isArrayIncreased(array2, 0)); // false
//        System.out.println(RecursionUtil.isArrayIncreased(array3, 0)); // true

        // 上楼梯
        int n = 5;
        int num = RecursionUtil.goUpstairs(n);
        System.out.printf("每次上1或2或3节楼梯，上%d节楼梯有：%d 种走法", n, num);
    }

}
